<template>
  <div class="rag-management">
    <div class="page-header">
      <h2>Modular RAG管理</h2>
      <p class="page-description">检索增强生成（RAG）模块化管理平台</p>
    </div>

    <div class="rag-overview">
      <el-row :gutter="20">
        <el-col :span="12">
          <el-card class="feature-card" @click="navigateToPage('NavigationRAG')" style="cursor: pointer;">
            <div class="feature-content">
              <el-icon class="feature-icon" size="48">
                <Guide />
              </el-icon>
              <h3>导航RAG</h3>
              <p>管理页面导航路径规划和RAG数据，支持导入导出和智能路径分析</p>
              <div class="feature-status">
                <el-tag type="success" size="small">已上线</el-tag>
              </div>
            </div>
          </el-card>
        </el-col>
        
        <el-col :span="12">
          <el-card class="feature-card" @click="navigateToPage('DocumentRAG')" style="cursor: pointer;">
            <div class="feature-content">
              <el-icon class="feature-icon" size="48">
                <Document />
              </el-icon>
              <h3>文档RAG</h3>
              <p>智能文档检索与问答，支持多格式文档解析和向量化存储</p>
              <div class="feature-status">
                <el-tag type="info" size="small">开发中</el-tag>
              </div>
            </div>
          </el-card>
        </el-col>
      </el-row>

      <el-row :gutter="20" style="margin-top: 20px;">
        <el-col :span="12">
          <el-card class="feature-card disabled">
            <div class="feature-content">
              <el-icon class="feature-icon" size="48">
                <Share />
              </el-icon>
              <h3>知识图谱RAG</h3>
              <p>基于知识图谱的智能问答，支持实体关系挖掘和推理</p>
              <div class="feature-status">
                <el-tag type="info" size="small">规划中</el-tag>
              </div>
            </div>
          </el-card>
        </el-col>
        
        <el-col :span="12">
          <el-card class="feature-card disabled">
            <div class="feature-content">
              <el-icon class="feature-icon" size="48">
                <DataAnalysis />
              </el-icon>
              <h3>多模态RAG</h3>
              <p>支持文本、图像、音频等多模态内容的检索增强生成</p>
              <div class="feature-status">
                <el-tag type="info" size="small">规划中</el-tag>
              </div>
            </div>
          </el-card>
        </el-col>
      </el-row>
    </div>

    <div class="rag-stats">
      <el-card>
        <template #header>
          <span>RAG统计概览</span>
        </template>
        <el-row :gutter="20">
          <el-col :span="6">
            <div class="stat-item">
              <div class="stat-number">2</div>
              <div class="stat-label">已上线模块</div>
            </div>
          </el-col>
          <el-col :span="6">
            <div class="stat-item">
              <div class="stat-number">1</div>
              <div class="stat-label">开发中模块</div>
            </div>
          </el-col>
          <el-col :span="6">
            <div class="stat-item">
              <div class="stat-number">2</div>
              <div class="stat-label">规划中模块</div>
            </div>
          </el-col>
          <el-col :span="6">
            <div class="stat-item">
              <div class="stat-number">100%</div>
              <div class="stat-label">系统可用性</div>
            </div>
          </el-col>
        </el-row>
      </el-card>
    </div>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router'
import { Guide, Document, Share, DataAnalysis } from '@element-plus/icons-vue'

const router = useRouter()

const navigateToPage = (routeName: string) => {
  router.push({ name: routeName })
}
</script>

<style scoped>
.rag-management {
  height: 100%;
  padding: 20px;
  background-color: #f5f5f5;
}

.page-header {
  margin-bottom: 20px;
  padding: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page-header h2 {
  margin: 0 0 8px 0;
  color: #303133;
  font-size: 24px;
  font-weight: 600;
}

.page-description {
  margin: 0;
  color: #606266;
  font-size: 14px;
}

.rag-overview {
  margin-bottom: 20px;
}

.feature-card {
  height: 200px;
  transition: all 0.3s ease;
  border-radius: 8px;
  overflow: hidden;
}

.feature-card:hover:not(.disabled) {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.feature-card.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.feature-card.disabled:hover {
  transform: none;
  box-shadow: none;
}

.feature-content {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
}

.feature-icon {
  color: #409eff;
  margin-bottom: 16px;
}

.feature-content h3 {
  margin: 0 0 12px 0;
  color: #303133;
  font-size: 18px;
  font-weight: 600;
}

.feature-content p {
  margin: 0 0 16px 0;
  color: #606266;
  font-size: 14px;
  line-height: 1.6;
  flex: 1;
}

.feature-status {
  margin-top: auto;
}

.rag-stats {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-item {
  text-align: center;
  padding: 20px;
}

.stat-number {
  font-size: 28px;
  font-weight: 600;
  color: #409eff;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 14px;
  color: #606266;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .rag-management {
    padding: 10px;
  }
  
  .feature-card {
    height: 180px;
    margin-bottom: 16px;
  }
  
  .feature-content {
    padding: 15px;
  }
  
  .feature-content h3 {
    font-size: 16px;
  }
  
  .feature-content p {
    font-size: 13px;
  }
  
  .stat-item {
    padding: 15px;
  }
  
  .stat-number {
    font-size: 24px;
  }
  
  .stat-label {
    font-size: 13px;
  }
}

@media (max-width: 576px) {
  :deep(.el-col) {
    margin-bottom: 16px;
  }
  
  .feature-card {
    height: 160px;
  }
}
</style> 